//
//  Request.h
//  iFlower
//
//  Created by trungdq
//  Copyright 2012. All rights reserved.
//

//#define  kBaseURL     (@"http://demo.vmodev.com/jungoo/%@") 
#define  kBaseURL       (@"http://5.79.0.122/%@")

#define  kCoursesList   (@"courses.php") 
#define  kCollegesList  (@"colleges.php") 
#define  kModulesList   (@"modules.php") 
#define  kLoginPage     (@"login.php")
#define  kUpdateProfile (@"updateprofile.php?uid=%@")
#define  kPhotoList     (@"list_image.php?uid=%@")
#define  kLoginFB       (@"fb_login.php")
#define  kFeedback      (@"feedback.php")
#define kUploadPhoto    (@"photoupload.php")
#define kPeople         (@"index.php/api/people?userId=%@&searchBy=%@&isFav=%@")

#import <Foundation/Foundation.h>

extern NSString * const kCategoryPattern;

@class User;
@class Request;

@protocol RequestDelegate <NSObject>

- (void)beginLoadCourses:(Request*)aRequest;
- (void)endLoadCourses:(Request*)aRequest responseData:(NSString*)jsonData;

@end

@interface Request : NSObject {
	NSMutableData* json_;
	NSURLConnection* connection_;
	id entries_;
    int flag;
}

@property (nonatomic,readonly) id entries;
@property (nonatomic,assign) int flag;
@property (assign) id<RequestDelegate> delegate;

//+ (Request *)sharedRequest;

- (void)getCourses;
- (void)getColleges;
- (void)getModules;
- (void)getPhotos:(User*)user;
- (void)login:(User*)user;
- (void)loginByFB:(NSString*)data; 
- (void)updateProfile:(User*)user;
- (NSData *)sendSynchronousRequest:(NSURL*)url ;
- (void)submitfeedback:(NSString*)data;
- (void)saveUserAvatarWithUserId:(NSString*)userId avatarData:(NSData*)avatarData;
- (void)getPeoples:(NSString*)userId searchBy:(NSString*)searchBy isFav:(NSString*)isFav;

@end
